<extend name="Public/layout" />

<block name="content">
    <section class="wrapper">
        <!-- page start-->
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading">
                        增加管理员
                    </header>
                    <div class="panel-body">
                        <div class=" form">
                            <form class="ajax-from-submit" action="{:U('Admin/AdminUser/edit')}" method="post">
                                <input type="hidden" name="id" value="{$Think.get.id}">
                                <div class="form-group">
                                    <label for="role_id">用户角色</label>
                                    <select name="role_id" id="role_id" class="form-control">
                                        <volist name="role" id="vo">
                                            <option value="{$vo.id}" <if condition="$vo.id eq $user['role_id']">selected="selected" </if>>{$vo.name}</option>
                                        </volist>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="username">用户名</label>
                                    <input name="username" value="{$user.username}" type="text" class="form-control"  id="username" placeholder="请输入用户名" required>
                                </div>
                                <div class="form-group">
                                    <label for="password">登录密码</label>
                                    <input name="password" value="" type="password" class="form-control"  id="password" placeholder="请输入登录密码" required>
                                </div>
                                <div class="form-group">
                                    <label for="realname">真实姓名</label>
                                    <input name="realname" value="{$user.realname}" type="text" class="form-control" id="realname" placeholder="请输入真实姓名" required>
                                </div>
                                <div class="form-group">
                                    <label for="phone">手机号码</label>
                                    <input name="phone" value="{$user.phone}" type="text" class="form-control" id="phone" placeholder="请输入手机号码" required>
                                </div>
                                <div class="form-group">
                                    <label for="email">邮箱</label>
                                    <input name="email" value="{$user.email}" type="text" class="form-control" id="email" placeholder="请输入邮箱">
                                </div>
                                <div class="form-group">
                                    <label for="status">状态</label>
                                    <select name="status" id="status" class="form-control">
                                        <option value="0" <eq name="user.status" value="0">selected="selected"</eq>>启用</option>
                                        <option value="1" <eq name="role.status" value="1">selected="selected"</eq>>禁用</option>
                                    </select>
                                </div>
                                <div class="form-group " >
                                    <button class="btn btn-info ajax-form-btn" type="submit">提交</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </section>
            </div>
        </div>
        <!-- page end-->
    </section>
</block>
<block name="javascript">
    <script>
        //菜单高亮
        MenuHighlight('{:U("Admin/AdminUser/index")}');
    </script>
</block>